package demo;


public class Test2 {

    public static void main(String[] args) throws InterruptedException {
        Thread thread1 = new Thread(()->{
            Object locker = new Object();
            //会发生死锁，只是是可重入锁（两个锁一样）
             synchronized (locker){
                 synchronized (locker){
                     System.out.println(1);
                 }
             }
        });
        thread1.start();
        thread1.join();
    }

}
